ANDK L4 22 OnCreate Vs OnSmart SC
Code in onCreate
Given what we just explored about lifecycle state, answer the following. Right now we initialize dessertsSold to 0 at declaration. Let's say we also set dessertsSold to 0 in onCreate. What, if anything, would change?
The app would work the same
Whenever you navigate away from the activity and come back, you'd lose the revenue value
The app would crash
Whenever you pressed the share button, the game would restart
You'd never be able to get beyond making cupcakes
Next Concept